<!DOCTYPE html>
<html>
<head>
	<title>诺亚阳湖大闸蟹</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<script src="../Public/js/jquery-1.9.1.min.js"></script>
	<script src="../Public/js/resize.js"></script>
	<link rel="stylesheet" href="../Public/css/layout.css" type="text/css"/>
</head>
<body class="bg2">
	<div class="wrapper">
		<div class="top-banner">
			<img src="../Public/images/yhy_banner.jpg">
		</div>
		<div class="form-box bg2 clearfix">
			<form method="post" id="verification" class="verification" name="verification" action="{:U('Couponorder/verification')}" enctype="multipart/form-data" >
				<div class="form-group">
					<label for="number">礼品卡号：</label>
					<input name="number" id="number" type="text" class="text" value="" autocomplete="off" datatype="*8-14" nullmsg="礼卡卡号不能为空！" errormsg="礼卡卡号格式不正确！" >
				</div>
				<div class="form-group">
					<label for="password">验证密码：</label>
					<input name="password" id="password" type="password" class="text" value="" autocomplete="off" datatype="*6-10" nullmsg="礼卡密码不能为空！" errormsg="礼卡密码格式不正确！" >
				</div>
				<div class="send clearfix">
					<button type="button" class="btn-primary btn1" id="submitbtn"><i></i>&nbsp;提 蟹&nbsp;<i></i></button>
					<!--<button type="button" class="btn-primary" id="btn_srh"><i></i>&nbsp;查 询&nbsp;<i></i></button>-->
				</div>
			</form>
		</div>
		<footer style="font-size:0.2em">
			<p>@江苏大胃王网络科技有限公司 @江苏优华生态科技有限公司</p>
			<p>@江苏诺亚方舟农业科技有限公司 电话：400-100-1561</p>
		</footer>
	</div>
	<!--
    <div data-role="header" data-position="fixed">
        <h1>{$sitename}</h1>
    </div>
	<div data-role="content">              
		<form method="post" data-transition="pop" id="verification" class="verification" name="verification" action="{:U('Couponorder/verification')}" enctype="multipart/form-data" >
		
			<div data-role="fieldcontain">
				<label for="number">礼卡卡号</label>
				<input type="text" name="number" id="number" value="" placeholder="请输入礼卡卡号" />
			</div>
			
			<div data-role="fieldcontain">
				<label for="password">礼卡密码</label>
				<input type="password" name="password" id="password" value="" placeholder="请输入礼卡密码" />
			</div>
			
		    <input type="button" name="submit" id="submitbtn" value="提 蟹"  />  
	
		</form>
	</div>
	-->
	<script>
	$(function(){
	   	$("#submitbtn").bind("click",function()
		{
	   		number = $("#number").val();
	   		password = $("#password").val();
	   		
	   		if({$sitestatus}){
                if(1 == {$sitestatus}){
                    alert("{$indexdesc}"); return false;
                }
			}
	   		
	   		if(!number){
	   			alert('礼卡卡号不能为空！'); return false;
	   		}
	   		
	   		if(number.length < 8 || number.length > 14){
	   			alert('礼卡格式错误！'); return false;
	   		}
	   		
	   		if(!password){
	   			alert('密码不能为空！'); return false;
	   		}
	   		
	   		if(password.length < 6 || password.length > 10){
	   			alert('密码格式错误！'); return false;
	   		}
	   		
	   		var formData = $("#verification").serialize();
	   		
            $.ajax({
                type: "POST",
                url: "{:U('Couponorder/verification')}",
                cache: false,
                data: formData,
                dataType: "json",
                success: function(data){
                	if(data.status == 1){
                		alert(data.info);
                		//setTimeout(function(){
                			window.location.href="{:U('Couponorder/address')}"; 
        				//},1000);
					}else if(data.status == 2){
						alert(data.info);
                		//setTimeout(function(){
                			window.location.href="{:U('Couponorder/myads')}"; 
        				//},1000);
					}else{
						alert(data.info);
					}
                },
                error: function(data){
                	alert('提交失败！');
                }
            });
	   		
            return false;
		});
	});
	</script>
</body>
</html>
